package com.zc58s.springbootmqtt.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author : fujc-dev@qq.com
 * @created : 2022/9/21 12:59
 */

@Configuration
public class Mqtt3Config {

    @Bean
    public ExecutorService taskExecutor() {
        ExecutorService executorService = new ThreadPoolExecutor(10,
                20,
                100L,
                TimeUnit.MILLISECONDS,
                new LinkedBlockingQueue<Runnable>());
        return executorService;
    }

}
